package com.example.customview.scrollevent.`in`

import com.alibaba.android.arouter.facade.annotation.Route
import com.android.baselibrary.base.BaseDBFragment
import com.example.customview.R
import com.example.customview.arouter.CustomArouter
import com.example.customview.databinding.FragmentScrollInBinding


@Route(path = CustomArouter.CUSTOM_SCROLLER_IN_FRAGMENT)
class ScrollerInFragment:BaseDBFragment<FragmentScrollInBinding>(R.layout.fragment_scroll_in) {


    private val iv = intArrayOf(
        R.mipmap.iv_0, R.mipmap.iv_1, R.mipmap.iv_2,
        R.mipmap.iv_3, R.mipmap.iv_4, R.mipmap.iv_5,
        R.mipmap.iv_6, R.mipmap.iv_7, R.mipmap.iv_8
    )
    override fun initView() {
        val strings: MutableList<Map<String, Int>> = ArrayList()

        var map: MutableMap<String, Int>

        for (i in 0..19) {
            map = HashMap()
            map["key"] = iv[i % 9]
            strings.add(map)
        }
        val adapter = MyPagerAdapter(requireContext(), strings)
        mBinding.viewPager.adapter = adapter
    }

}